<!--下拉框组件 -->
<template>
  <el-select v-model="value" placeholder="请选择">
    <el-option
      v-for="item in options"
      :key="item.id"
      :label="item.name"
      :value="item.code"
      @change='changeData'>
    </el-option>
  </el-select>
</template>

<script>
  export default {
    props: {
      selectList: {
        type: Array,
        default: () => []
      }
    },
    data() {
      return {
        options: [],
        value:''
      }
    },
    created(){
      
    },
    methods:{
      changeData(){
        this.$emit('emitEvt',{
            changeValue:this.value
        })
      }
    },
    watch: {
      selectList() {
        this.options = this.selectList
      }
    }
  }
</script>